<?
include '../includes/specs_functions.php';
#------------------------------------------------------------------------
# Connect to PADS
$DB = getDB();
#-------------------------------$Session information
$SESSION = get_session($DB);
$CICUID = $SESSION->Character;
$THEME = $_POST["THEME"];
#---------------------------------------------------

$output = json_encode(array("status"=>"error", "message"=>"NO"));

$commentId = $_POST['commentId'];

if($CICUID != ""){
	
	
	/* TODO WITH PDO  */
	/*$abfrage = "
		DELETE FROM ffxivc_comments WHERE
			commentid = \"".$commentId."\"
			AND 
			userId = \"".$CICUID."\"";
	$res = mysql_query($abfrage);
		
	if ($res){
		$output = json_encode(array("status"=>"success", "message"=>"DELETE"));
	}*/
	$table = SPEC_TBL_COMMENTS;
	$where = array(
					SPEC_TBL_COMMENTS_ID ."= \"".$commentId."\""
					,SPEC_TBL_COMMENTS_USER_ID ."= \"".$CICUID."\""
				);
	
	$result = $DB->Remove($table ,$where);
		
	if ($result[0][1] == 0)
	{
		$output = json_encode(array("status"=>"success", "message"=>"DELETE"));
	}
	
	
	

}

echo $output; 
#------------------------------------------------------------------------
# Disconnect
leaveDB($DB);
?>